package cn.strive.eams.roomRequire.service.impl;

import cn.strive.eams.roomRequire.mapper.RoomRequireMapper;
import cn.strive.eams.roomRequire.pojo.dto.RoomRequireSaveParam;
import cn.strive.eams.roomRequire.pojo.entity.RoomRequire;
import cn.strive.eams.roomRequire.service.RoomRequireService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Slf4j
@Service
public class RoomRequireServiceImpl implements RoomRequireService {
    @Autowired
    private RoomRequireMapper roomRequireMapper;

    @Override
    public void saveClsApply(RoomRequireSaveParam roomRequireSaveParam) {
        log.debug("保存教室申请信息:roomRequireSaveParam={}", roomRequireSaveParam);
        RoomRequire roomRequire = new RoomRequire();
        BeanUtils.copyProperties(roomRequireSaveParam, roomRequire);
        roomRequire.setCreateTime(new Date());
        roomRequireMapper.insert(roomRequire);
    }
}
